﻿@model SiteConfigViewModel
<div class="layui-row layui-col-space15">
	<div class="layui-col-md12">
		<div class="layui-card">
			<div class="layui-card-header">上传设置</div>
			<div class="layui-card-body" pad15>
				<form asp-controller="SiteConfig" asp-action="MailConfig" class="layui-form" wid100 lay-filter="">
					<div class="layui-form-item">
						<label class="layui-form-label">发送人邮箱</label>
						<div class="layui-input-block">
							<input type="text" class="layui-input" asp-for="MailConfigEntity.MailFrom" placeholder="例：someone@qq.com">
							<span asp-validation-for="MailConfigEntity.MailFrom" style="color:red;"></span>
						</div>
					</div>
					<div class="layui-form-item">
						<label class="layui-form-label">发送邮件服务器(SMTP)</label>
						<div class="layui-input-block">
							<input type="text" class="layui-input" asp-for="MailConfigEntity.MailServer" placeholder="例：smtp.qq.com">
							<span asp-validation-for="MailConfigEntity.MailServer" style="color:red;"></span>
						</div>
					</div>
					<div class="layui-form-item">
						<label class="layui-form-label">端口号</label>
						<div class="layui-input-block">
							<input type="text" class="layui-input" asp-for="MailConfigEntity.Port" placeholder="例：25">
							<span asp-validation-for="MailConfigEntity.Port" style="color:red;"></span>
						</div>
					</div>
					<div class="layui-form-item">
						<label class="layui-form-label">要求安全连接</label>
						<div class="layui-input-block">
							<input type="checkbox" asp-for="MailConfigEntity.EnabledSsl" lay-skin="primary" title="此服务器要求安全连接(SSL)">
						</div>
					</div>
					<div class="layui-form-item">
						<label class="layui-form-label">发件人用户名</label>
						<div class="layui-input-block">
							<input type="text" class="layui-input" asp-for="MailConfigEntity.MailServerUserName">
							<span asp-validation-for="MailConfigEntity.MailServerUserName" style="color:red;"></span>
						</div>
					</div>
					<div class="layui-form-item">
						<label class="layui-form-label">发件人的密码</label>
						<div class="layui-input-block">
							<input type="text" class="layui-input" asp-for="MailConfigEntity.MailServerPassWord">
							<span asp-validation-for="MailConfigEntity.MailServerPassWord" style="color:red;"></span>
						</div>
					</div>
					<div class="layui-form-item">
						<div class="layui-input-block">
							<button class="layui-btn" lay-submit lay-filter="">确认保存</button>
							<span style="color:red; font-size:18px;">@Html.ValidationSummary(true)</span>
						</div>
					</div>
					<div class="layui-form-item">
						<label class="layui-form-label">测试收件人邮箱</label>
						<div class="layui-input-inline" style="width:200px;">
							<input type="text" class="layui-input" value="" id="mailToAddress" name="mailToAddress" placeholder="例：someone@qq.com">
						</div>
						<div class="layui-input-inline layui-btn-container">
							<button class="layui-btn" type="button" onclick="SendMail('mailToAddress','subject','mailBody')">发送测试邮件</button>
							<input type="hidden" id="subject" name="subject" value="这是一封测试邮件，如果您可以成功收到此邮件，则说明您的“邮件参数配置”设置正确。" />
							<input type="hidden" id="mailBody" name="mailBody" value="这是一封测试邮件，如果您可以成功收到此邮件，则说明您的“邮件参数配置”设置正确。<a href='www.baidu.com'>百度</a>" />
						</div>
					</div>
				</form>
			</div>
		</div>
	</div>
</div>